This document was last updated at 2019-08-12 18:30:16.
This document is dedicated to the confirmatory choice analyses that were proposed for Experiment 3.
The design is 2 (difficulty: easier than reference vs. harder than reference) X 2 (difference: moderate vs. extreme). The analysis is a 2 X 2 within-subjects ANOVA on the proportion selection of the safe deck.
The critical prediction hinges on the main effect of difficulty. The prospect model predicts that choices will be risk averse when all outcomes are easier (or equal to) the reference deck, and that choices will be risk seeking when all outcomes are harder (or equal to) the reference deck. The predictions are visualized below:
All other hypotheses predict that choices won’t depend on difficulty. Concave up and down predict that choices, overall, will either be risk averse or risk seeking, respectively.
The cleaned data can be seen below
dst <- read.csv('../../../data/dstCleanChoice.csv')
n <- dst %>%
group_by(subject) %>%
summarize(n()) %>%
nrow()
dst
The sample size is 106.
The analyses below are broken down by different trimming criterion. The first tab (no trimming) has no trimming, the second tab has trimming according to to +/- 2 SDs on participant-wise cued RT means (see here), the third tab has trimming according to participant-wise exclusions based on choice (see here).
I’ll first visualize the results broken down across the whole design, followed by a breakdown by only the critical difficulty variable.
dst <- dst %>%
mutate(difference = factor(difference, levels = levels(difference)[c(2,1)]),
selSafeDeck = ifelse(selectedRiskyDeck == 1, 0, 1))
dst %>%
group_by(subject, difference, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference, difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd, group = difference)) +
geom_bar(stat = 'identity', aes(fill = difference), color = 'black', position = position_dodge(width = 0.9)) +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), position = position_dodge(width = 0.9), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0, 1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
scale_fill_manual(name = 'Difference', values = c(Moderate = 'light grey', Extreme = 'black')) +
theme_bw()
Main effect of difficulty:
dst %>%
group_by(subject, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_bar(stat = 'identity') +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0,1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
theme_bw()
Visualize subject data underlying the difficulty variable:
uSubjects <- unique(dst$subject)
subjectCode <- data.frame(subject = uSubjects)
subjectCode$subjectLabel <- factor('', levels = c('Supports prospect theory', 'Opposite prospect theory', 'No difference'))
for (i in uSubjects) {
t <- dst[dst$subject == i, c('difficulty', 'selSafeDeck')]
mns <- c(e = mean(t[t$difficulty == 'Easier than Reference',]$selSafeDeck), h = mean(t[t$difficulty == 'Harder than Reference',]$selSafeDeck))
if (mns[1] != mns[2]) {
m1 <- t.test(t[t$difficulty == 'Easier than Reference',]$selSafeDeck, t[t$difficulty == 'Harder than Reference',]$selSafeDeck, within = TRUE)
} else {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'No difference'
next
}
if (mns['e'] > mns['h'] & m1$p.value < .05) {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'Supports prospect theory'
} else if (mns['e'] < mns['h'] & m1$p.value < .05) {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'Opposite prospect theory'
} else {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'No difference'
}
}
dst <- subjectCode %>%
inner_join(dst)
condMeans <- dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(ssd))
# dst %>%
# group_by(subject, subjectLabel) %>%
# summarize(count = n()) %>%
# group_by(subjectLabel) %>%
# summarize(count = n())
dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_violin(fill = NA, alpha = 0.2) +
geom_boxplot(fill = NA, alpha = 0.3) +
geom_jitter(alpha = 0.4, width = .05, height = 0) +
geom_line(aes(group = subject), linetype = 'dashed', alpha = .3) +
geom_point(data = condMeans, aes(x = difficulty, y = ssd), size = 4, shape = 23, color = 'black', fill = 'red') +
geom_hline(yintercept = 0.5, linetype = 'dotted') +
geom_label(data = condMeans, aes(x = difficulty, y = ssd, label = round(ssd, 2)), hjust = 1.5, vjust = 1.5) +
#scale_color_manual(name = 'Subject Label', values = c(`Supports prospect theory` = 'dark green', `Opposite prospect theory` = 'red', `No difference` = 'black')) +
ylim(0,1) +
theme_bw() +
labs(
title = 'Selection of safe deck by difficulty and subject',
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Red diamond reflects condition means. Horizontal, black, solid lines reflect medians.'
) +
theme(legend.position = 'bottom')
m1 <- ezANOVA(wid = subject, within = .(difference, difficulty), dv = selSafeDeck, data = dst, detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
m1a <- data.frame(m1$ANOVA)
m1a$p <- round(m1a$p, 3)
m1a$n2p <- round(m1a$SSn / (m1a$SSn + m1a$SSd),3)
m1a
Means for difference effect
dst %>%
group_by(difference, subject) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck)/ sqrt(n))
Simple effect of difficulty across difference conditions
Following up on the marginal interaction by comparing the two extreme conditions:
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Extreme',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Extreme difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
And comparing the two moderate conditions
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Moderate',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Moderate difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Simple effects of difference across difficulty conditions
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Easier than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for easier than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Harder than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for harder than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
I’ll first visualize the results broken down across the whole design, followed by a breakdown by only the critical difficulty variable.
dst <- read.csv('../../../data/dstCleanChoice1.csv')
dst <- dst %>%
mutate(difference = factor(difference, levels = levels(difference)[c(2,1)]),
selSafeDeck = ifelse(selectedRiskyDeck == 1, 0, 1))
dst %>%
group_by(subject, difference, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference, difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd, group = difference)) +
geom_bar(stat = 'identity', aes(fill = difference), color = 'black', position = position_dodge(width = 0.9)) +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), position = position_dodge(width = 0.9), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0, 1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
scale_fill_manual(name = 'Difference', values = c(Moderate = 'light grey', Extreme = 'black')) +
theme_bw()
Main effect of difficulty:
dst %>%
group_by(subject, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_bar(stat = 'identity') +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0,1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
theme_bw()
Visualize subject data underlying the difficulty variable:
condMeans <- dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(ssd))
# dst %>%
# group_by(subject, subjectLabel) %>%
# summarize(count = n()) %>%
# group_by(subjectLabel) %>%
# summarize(count = n())
dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_violin(fill = NA, alpha = 0.2) +
geom_boxplot(fill = NA, alpha = 0.3) +
geom_jitter(alpha = 0.4, width = .05, height = 0) +
geom_line(aes(group = subject), linetype = 'dashed', alpha = .3) +
geom_point(data = condMeans, aes(x = difficulty, y = ssd), size = 4, shape = 23, color = 'black', fill = 'red') +
geom_hline(yintercept = 0.5, linetype = 'dotted') +
geom_label(data = condMeans, aes(x = difficulty, y = ssd, label = round(ssd, 2)), hjust = 1.5, vjust = 1.5) +
scale_color_manual(name = 'Subject Label', values = c(`Supports prospect theory` = 'dark green', `Opposite prospect theory` = 'red', `No difference` = 'black')) +
ylim(0,1) +
theme_bw() +
labs(
title = 'Selection of safe deck by difficulty and subject',
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Red diamond reflects condition means. Horizontal, black, solid lines reflect medians.'
) +
theme(legend.position = 'bottom')
m1 <- ezANOVA(wid = subject, within = .(difference, difficulty), dv = selSafeDeck, data = dst, detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
m1a <- data.frame(m1$ANOVA)
m1a$p <- round(m1a$p, 3)
m1a$n2p <- round(m1a$SSn / (m1a$SSn + m1a$SSd),3)
m1a
Means for difference effect
dst %>%
group_by(difference, subject) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck)/ sqrt(n))
Simple effect of difficulty across difference conditions
Following up on the marginal interaction by comparing the two extreme conditions:
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Extreme',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Extreme difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
And comparing the two moderate conditions
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Moderate',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Moderate difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Simple effects of difference across difficulty conditions
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Easier than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for easier than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Harder than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for harder than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
I’ll first visualize the results broken down across the whole design, followed by a breakdown by only the critical difficulty variable.
dst <- read.csv('../../../data/dstCleanChoice2.csv')
dst <- dst %>%
mutate(difference = factor(difference, levels = levels(difference)[c(2,1)]),
selSafeDeck = ifelse(selectedRiskyDeck == 1, 0, 1))
dst %>%
group_by(subject, difference, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference, difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd, group = difference)) +
geom_bar(stat = 'identity', aes(fill = difference), color = 'black', position = position_dodge(width = 0.9)) +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), position = position_dodge(width = 0.9), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0, 1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
scale_fill_manual(name = 'Difference', values = c(Moderate = 'light grey', Extreme = 'black')) +
theme_bw()
Main effect of difficulty:
dst %>%
group_by(subject, difficulty) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck) / sqrt(n)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_bar(stat = 'identity') +
geom_errorbar(aes(ymin = ssd - se, ymax = ssd + se), width = 0.5) +
labs(
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Dashed line represents selecting at chance'
) +
ylim(0,1) +
geom_hline(yintercept = 0.5, linetype = 'dashed') +
theme_bw()
Visualize subject data underlying the difficulty variable:
uSubjects <- unique(dst$subject)
subjectCode <- data.frame(subject = uSubjects)
subjectCode$subjectLabel <- factor('', levels = c('Supports prospect theory', 'Opposite prospect theory', 'No difference'))
for (i in uSubjects) {
t <- dst[dst$subject == i, c('difficulty', 'selSafeDeck')]
mns <- c(e = mean(t[t$difficulty == 'Easier than Reference',]$selSafeDeck), h = mean(t[t$difficulty == 'Harder than Reference',]$selSafeDeck))
if (mns[1] != mns[2]) {
m1 <- t.test(t[t$difficulty == 'Easier than Reference',]$selSafeDeck, t[t$difficulty == 'Harder than Reference',]$selSafeDeck, within = TRUE)
} else {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'No difference'
next
}
if (mns['e'] > mns['h'] & m1$p.value < .05) {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'Supports prospect theory'
} else if (mns['e'] < mns['h'] & m1$p.value < .05) {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'Opposite prospect theory'
} else {
subjectCode[subjectCode$subject == i,]$subjectLabel <- 'No difference'
}
}
dst <- subjectCode %>%
inner_join(dst)
condMeans <- dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
group_by(difficulty) %>%
summarize(ssd = mean(ssd))
#
# dst %>%
# group_by(subject, subjectLabel) %>%
# summarize(count = n()) %>%
# group_by(subjectLabel) %>%
# summarize(count = n())
dst %>%
group_by(subject, difficulty) %>%
summarize(ssd = mean(selSafeDeck)) %>%
ggplot(aes(x = difficulty, y = ssd)) +
geom_violin(fill = NA, alpha = 0.2) +
geom_boxplot(fill = NA, alpha = 0.3) +
geom_jitter(alpha = 0.4, width = .05, height = 0) +
geom_line(aes(group = subject), linetype = 'dashed', alpha = .3) +
geom_point(data = condMeans, aes(x = difficulty, y = ssd), size = 4, shape = 23, color = 'black', fill = 'red') +
geom_hline(yintercept = 0.5, linetype = 'dotted') +
geom_label(data = condMeans, aes(x = difficulty, y = ssd, label = round(ssd, 2)), hjust = 1.5, vjust = 1.5) +
#scale_color_manual(name = 'Subject Label', values = c(`Supports prospect theory` = 'dark green', `Opposite prospect theory` = 'red', `No difference` = 'black')) +
ylim(0,1) +
theme_bw() +
labs(
title = 'Selection of safe deck by difficulty and subject',
x = 'Difficulty',
y = 'Proportion Selection of Safe Deck',
caption = 'Red diamond reflects condition means. Horizontal, black, solid lines reflect medians.'
) +
theme(legend.position = 'bottom')
m1 <- ezANOVA(wid = subject, within = .(difference, difficulty), dv = selSafeDeck, data = dst, detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
m1a <- data.frame(m1$ANOVA)
m1a$p <- round(m1a$p, 3)
m1a$n2p <- round(m1a$SSn / (m1a$SSn + m1a$SSd),3)
m1a
Means for difference effect
dst %>%
group_by(difference, subject) %>%
summarize(selSafeDeck = mean(selSafeDeck)) %>%
group_by(difference) %>%
summarize(ssd = mean(selSafeDeck), se = sd(selSafeDeck)/ sqrt(n))
Simple effect of difficulty across difference conditions
Following up on the marginal interaction by comparing the two extreme conditions:
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Extreme',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Extreme difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
And comparing the two moderate conditions
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difficulty), dv = selSafeDeck, data = dst[dst$difference == 'Moderate',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difficulty for Moderate difference'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Simple effects of difference across difficulty conditions
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Easier than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for easier than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
Effect of difference for easier than reference difficulty.
DFd <- m1$ANOVA$DFd[4]
SSd <- m1$ANOVA$SSd[4]
MSe <- SSd / DFd
omnibusParams <- c(DFd = DFd, SSd = SSd, MSe = MSe)
m2 <- ezANOVA(wid = subject, within = .(difference), dv = selSafeDeck, data = dst[dst$difficulty == 'Harder than Reference',], detailed = TRUE)
## Warning: Converting "subject" to factor for ANOVA.
## Warning: Collapsing data to cell means. *IF* the requested effects are a
## subset of the full design, you must use the "within_full" argument, else
## results may be inaccurate.
s <- 'Simple effect of difference for harder than reference difficulty'
r <- formatSimpleEffects(omnibusParams = omnibusParams, model = m2)
data.frame(Contrast = s, Result = r)
A work by Dave Braun
dab414@lehigh.edu